<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>好运来购物平台</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <script src="/layui/layui.js"></script>
    <script src="/lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>

    <!-- 第一个模块的链接地址 -->
    <script>
        function changetab(title) {
            var url = "";

            switch (title) {
                case 'usertable':                //和下面的对应  方法的名字
                    url = "./user/userList.html";    //方法的地址
                    break;

                case 'Bar':
                    url = "./division_staff/division_staffList.html";
                    break;
                case 'studentlist':
                    url = "./timecard/timecardList.html";
                    break;

                default:
                    break;
            }

            $("#main").attr("src", url);
        }
    </script>

    <!-- 第二个模块的链接地址 -->
    <script>
        function goodtab(title){
            var url="";
            switch (title) {
                case 'usertable':
                    url="./Goods/GoodList.html";
                    break;

                case 'Bar':
                    url="./Goods/Bar.html";
                    break;
                case 'studentlist':
                    url="./Goods/goodadd.html";
                    break;

                case 'goodpush':
                    url="./Goods/userPushlist.html";
                    break;

                case 'userPushList':
                    url="./Goods/Goodpushlist.html";
                    break;    

                default:
                    break;
            }

            $("#main").attr("src",url);
        }
    </script>

    <!-- 第三个模块的链接地址 -->
    <script>
        function order(title){
            var url="";
            switch (title) {

                case 'orderManage':
                    url="./orderManage/orderManageList.html";
                    break;

                case 'comment':
                    url="./comment/commentList.html";
                    break;
                case 'operate':
                    url="./operate/operateList.html";
                    break;
                 case 'refundAfterSale':
                    url="./refundAfterSale/refundAfterSaleList.html";
                    break;
                case 'settlement':
                    url="./settlement/settlementList.html";
                    break;

                default:
                    break;
            }

            $("#main").attr("src",url);
        }
    </script>

    <!-- 第四个模块的链接地址
    <script>
        function logistics(title){
            var url="";
            switch (title) {
                case 'logistics':
                    url="./Logistics/Logistics.html";
                    break;

                case 'Bar':
                    url="./Logistics/Bar.html";
                    break;
                case 'studentlist':
                    url="./TheTestSystem/TheTestSystemlist.html";
                    break;

                default:
                    break;
            }

            $("#main").attr("src",url);
        }
    </script> -->


    <!-- 第五个模块的链接地址 -->
    <script>
        function yyhtab(title) {
            var url = "";
            switch (title) {
                case 'principal':
                    url = "./principal/principalList.html";
                    break;

                case 'error':
                    url = "./error/errorList.html";
                    break;
                case 'aftersale':
                    url = "./aftersale/aftersaleList.html";
                    break;

                default:
                    break;
            }

            $("#main").attr("src", url);
        }
    </script>

    <!-- 第六个模块的链接地址 -->
    <script>
        function frb(title){
            var url="";
            switch (title) {
                case 'messagetable':
                    url="./message/messageList.html";
                    break;

                case 'itemtable':
                    url="./item/itemList.html";
                    break;
                case 'gradetable':
                    url="./grade/gradeList.html";
                    break;

                default:
                    break;
            }

            $("#main").attr("src",url);
        }
    </script>


    <!-- 第七个模块的链接地址 -->
    <script>
        function cyltab(title) {
            var url = "";
            switch (title) {
                case 'statistics':
                    url = "./statistics/statistics.html";
                    break;

                case 'statisticsBar':
                    url = "./statistics/statisticsBar.html";
                    break;

                case 'statisticsPie':
                    url = "./statistics/statisticsPie.html";
                    break;
                

                default:
                    break;
            }

            $("#main").attr("src", url);
        }
    </script>

    <!-- 第八个模块的链接地址 -->
    <!-- 志鹏 -->
    <script>
        function member(title){
            var url="";
            switch (title) {
                case 'vip_admin':
                    url="./MemberSystem/Member.html";
                    break;

                case 'Vipmember':
                    url="./MemberSystem/Vipmember.html";
                    break;
                case 'VipInform':
                    url="./MemberSystem/VipInform.html";
                    break;

                default:
                    url="../main"
                    break;
            }

            $("#main").attr("src",url);
        }
    </script>

    <!-- 第九个模块的链接地址 -->
    <script>
        function ffhtab(title){
            var url="";
            switch (title) {
                case 'storage':
                    url="./storage/storageList.html";
                    break;

                case 'intostorage':
                    url="./storage/intostorageList.html";
                    break;
                case 'outstorage':
                    url="./storage/outstorageList.html";
                    break;

                default:
                    break;
            }

            $("#main").attr("src",url);
        }
    </script>

    <!-- 第十个模块的链接地址 -->
    <script>
        function zhsfintab(title){
            var url="";
            switch (title) {
                case 'finstorag':
                    url="./Finance/finstoragList.html";
                    break;

                case 'finmember':
                    url="./Finance/finmemberList.html";
                    break;
                case 'finuser':
                    url="./Finance/finuserList.html";
                    break;

                case 'fintotal':
                    url="./Finance/fintotalList.html";
                    break;

                default:
                    break;
            }

            $("#main").attr("src",url);
        }
    </script>



</head>

<body>
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <!--  左上角标题的位置-->
            <div class="layui-logo layui-hide-xs layui-bg-black">好运来购物平台</div>
            <!-- 头部区域（可配合layui 已有的水平导航） -->
            <ul class="layui-nav layui-layout-left">
                <!-- 移动端显示 -->
                <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-header-event="menuLeft">
                    <i class="layui-icon layui-icon-spread-left"></i>
                </li>
               
   
                <li class="layui-nav-item layui-hide-xs"><a href="">首页</a></li>
                <li class="layui-nav-item layui-hide-xs" style="align-content: center;"><a href="">好运来购物平台</a></li>
            
                <!-- <li class="layui-nav-item">
                    <a href="javascript:;">nav groups</a>
                    <dl class="layui-nav-child">
                        <dd><a href="">menu 11</a></dd>
                        <dd><a href="">menu 22</a></dd>
                        <dd><a href="">menu 33</a></dd>
                    </dl>
                </li> -->
            </ul>
            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item layui-hide layui-show-md-inline-block">
                    <a href="javascript:;">
                        <img src="https://j2207.oss-cn-hangzhou.aliyuncs.com/j2207/12.jpg"
                            class="layui-nav-img">
                        <span id="currentUser">
                         
                        </span>
                    </a>
                   
                </li>
                <li class="layui-nav-item" lay-header-event="menuRight" lay-unselect>
                    <a href="javascript:;">
                        <i class="layui-icon layui-icon-more-vertical"></i>
                    </a>
                </li>
            </ul>
        </div>
        <!-- 总体模块 -->
        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll">
                <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
                <ul class="layui-nav layui-nav-tree" lay-filter="test">
                    <!-- layui-nav-itemed 把这个删掉是默认不展开 -->
                    <!-- 第一个模块 赵高逸-->
                    <li class="layui-nav-item ">
                        <a class="" href="javascript:;">员工系统</a>
                        <dl class="layui-nav-child">
                            <dd><a href="javascript:;" onclick="changetab('usertable')">用户</a></dd>
                            <!--//方法的名字 和上面对应-->
                            <dd><a href="javascript:;" onclick="changetab('Bar')">员工分工</a></dd>
                            <dd><a href="javascript:;" onclick="changetab('studentlist')">考勤</a></dd>
                        
                        </dl>
                    </li>
                    <!-- 第二个模块 范正夏 -->
                    <li class="layui-nav-item ">
                        <a class="" href="javascript:;">商品信息</a>
                        <dl class="layui-nav-child">
                            <dd ><a href="javascript:;" onclick="goodtab('usertable')">商品列表</a></dd>
                            <dd ><a href="javascript:;" onclick="goodtab('Bar')">商品数据</a></dd>
                            <dd><a href="javascript:;" onclick="goodtab('studentlist')" >添加商品</a></dd>
                            <dd><a href="javascript:;" onclick="goodtab('goodpush')" >商品推送模块</a></dd>
                            <dd><a href="javascript:;" onclick="goodtab('userPushList')" >商品推送表单</a></dd>
                        </dl>
                    </li>
                    <!-- 第三个模块 张文昌-->
                    <li class="layui-nav-item ">
                        <a class="" href="javascript:;">订单系统</a>
                        <dl class="layui-nav-child">
                            <dd ><a href="javascript:;" onclick="order('orderManage')">订单管理</a></dd>
                            <dd ><a href="javascript:;" onclick="order('settlement')">结算订单</a></dd>
                            <dd><a href="javascript:;" onclick="order('comment')" >评价管理</a></dd>
                            <dd><a href="javascript:;" onclick="order('refundAfterSale')" >退款售后</a></dd>
                            <dd><a href="javascript:;" onclick="order('operate')" >商品操作</a></dd>
                        </dl>
                    </li>
                    <!-- 第四个模块 待定
                    <li class="layui-nav-item ">
                        <a class="" href="javascript:;">物流模块</a>
                        <dl class="layui-nav-child">
                            <dd ><a href="javascript:;" onclick="logistics('logistics')">物流公司</a></dd>
                            <dd ><a href="javascript:;" onclick="logistics('Bar')">货物信息</a></dd>
                            <dd><a href="javascript:;" onclick="logistics('studentlist')" >物流状态</a></dd>
                        </dl>
                    </li> -->
                    <!-- 第五个模块 杨宇浩-->
                    <li class="layui-nav-item">
                        <a class="" href="javascript:;">运营日志</a>
                        <dl class="layui-nav-child">
                            <dd><a href="javascript:;" onclick="yyhtab('principal')">负责人相关</a></dd>
                            <dd><a href="javascript:;" onclick="yyhtab('error')">失误日志</a></dd>
                            <dd><a href="javascript:;" onclick="yyhtab('aftersale')">售后服务</a></dd>

                        </dl>
                    </li>
                    <!-- 第六个模块 范瑞彪-->
                    <li class="layui-nav-item ">
                        <a class="" href="javascript:;">合作商系统</a>
                        <dl class="layui-nav-child">
                            <dd ><a href="javascript:;" onclick="frb('messagetable')">合作商信息</a></dd>
                            <dd ><a href="javascript:;" onclick="frb('itemtable')">合作项目</a></dd>
                            <dd><a href="javascript:;" onclick="frb('gradetable')" >合作商等级</a></dd>
                        </dl>
                    </li>
                    <!-- 第七个模块 程毅龙-->
                    <li class="layui-nav-item ">
                        <a class="" href="javascript:;">统计系统</a>
                        <dl class="layui-nav-child">
                            <dd><a href="javascript:;" onclick="cyltab('statistics')">统计数据</a></dd>
                            <dd><a href="javascript:;" onclick="cyltab('statisticsBar')">数据柱状图</a></dd>
                            <dd><a href="javascript:;" onclick="cyltab('statisticsPie')">数据饼图</a></dd>
                           
                            <dd><a href="">返回主页</a></dd>
                        </dl>
                    </li>
                    <!-- 第八个模块 -->
                    <!-- 李志鹏 -->
                    <li class="layui-nav-item">
                        <a class="" href="javascript:;">会员系统</a>
                        <dl class="layui-nav-child">
                            <dd ><a href="javascript:;" onclick="member('vip_admin')">会员管理</a></dd>
                            <dd ><a href="javascript:;" onclick="member('Vipmember')">会员特价</a></dd>
                            <dd><a href="javascript:;" onclick="member('VipInform')" >会员通告</a></dd>
                            <dd><a href="">返回主页</a></dd>
                        </dl>
                    </li>
                    <!-- 第九个模块 冯飞虎-->
                    <li class="layui-nav-item ">
                        <a class="" href="javascript:;">仓库系统</a>
                        <dl class="layui-nav-child">
                            <dd ><a href="javascript:;" onclick="ffhtab('storage')">库存信息</a></dd>
                            <dd ><a href="javascript:;" onclick="ffhtab('intostorage')">入库信息</a></dd>
                            <dd><a href="javascript:;" onclick="ffhtab('outstorage')" >出库信息</a></dd>
                        </dl>
                    </li>
                    <!-- 第十个模块 张鸿松-->
                    <li class="layui-nav-item ">
                        <a class="" href="javascript:;">财务系统</a>
                        <dl class="layui-nav-child">
                            <dd ><a href="javascript:;" onclick="zhsfintab('finstorag')">仓库财务信息</a></dd>
                            <dd ><a href="javascript:;" onclick="zhsfintab('finmember')">会员财务信息</a></dd>
                            <dd><a href="javascript:;" onclick="zhsfintab('finuser')" >用户财务信息</a></dd>
                            <dd><a href="javascript:;" onclick="zhsfintab('fintotal')" >总财务信息</a></dd>
                        </dl>
                    </li>



                </ul>
            </div>
        </div>

        <div class="layui-body">
            <!-- 内容主体区域 -->
            <!-- 进来的首页部分 -->
            <div style="padding: 15px;">
                <iframe id="main" src="./HomePage/home.html" frameborder="0"
                    style="width: 100%; height: 2000px;"></iframe>
            </div>
        </div>

        <div class="layui-footer">
            <!-- 底部固定区域 -->
            版权所有@java2207
        </div>
    </div>

    <script>
        //JS
        layui.use(['element', 'layer', 'util'], function () {
            var element = layui.element
                , layer = layui.layer
                , util = layui.util
                , $ = layui.$;

            var token = JSON.parse(localStorage.getItem("token"));
            $.ajaxSetup({
                // 发送cookie
                xhrFields: {
                    withCredentials: true
                },
                headers: {
                    "token": token
                }
            })

            // 从本地存储 把当前用户数据 取出来  并转为  js 对象
            var data = JSON.parse(localStorage.getItem("currentUser"));
            console.log(data);
            //alert(data.username);


            $("#currentUser").html(data.name);

            //头部事件
            util.event('lay-header-event', {
                //左侧菜单事件
                menuLeft: function (othis) {
                    layer.msg('展开左侧菜单的操作', { icon: 0 });
                }
                , menuRight: function () {
                    layer.open({
                        type: 1
                        , content: '<div style="padding: 15px;">处理右侧面板的操作</div>'
                        , area: ['260px', '100%']
                        , offset: 'rt' //右上角
                        , anim: 5
                        , shadeClose: true
                    });
                }
            });

        });
    </script>
</body>

</html>